package com.stone.back.user.entity;

import java.util.Date;


import com.stone.common.util.DateUtil;
import com.stone.common.util.SimpleDateSerializer;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 * BfUser entity. @author MyEclipse Persistence Tools
 */

public class BfUser implements java.io.Serializable {

	// Fields

	private Integer userid;
	private Integer countryid = 23;
	private String username;
    private String realname;
	private String password;
    private String oldpassword;
	private Integer sex;
	private Date birthday;
	private String email;
	private String phone;
	private String address;
	private Integer type;
	private Date createdate;
	private Integer createuserid;
	private BfCountry country;
	private String checkcode;
	private Integer status;

	// Constructors

	/** default constructor */
	public BfUser() {
	}

	/** full constructor */
	public BfUser(Integer countryid, String email, String username,
			String password, Integer sex, Date birthday, String phone, String address, 
			Integer type, Date createdate, Integer createuserid, String checkcode, Integer status) {
		this.countryid = countryid;
		this.username = username;
		this.password = password;
		this.sex = sex;
		this.birthday = birthday; 
		this.email = email;
		this.phone = phone;
		this.address = address;
		this.type = type;
		this.createdate = createdate;
		this.createuserid = createuserid;
		this.checkcode = checkcode;
		this.status = status;
	}

	// Property accessors

	public Integer getUserid() {
		return this.userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public Integer getCountryid() {
		return this.countryid;
	}

	public void setCountryid(Integer countryid) {
		this.countryid = countryid;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

        @JsonSerialize(using=SimpleDateSerializer.class)
	public Date getBirthday() {
		return birthday;
	}

        @JsonIgnore
	public String getBirthdayStr() {
		if(null == birthday){
			return "";
		} else {
			return DateUtil.dateFormatStr(DateUtil.DATE_FORMAT, this.birthday);
		}
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Date getCreatedate() {
		return this.createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

        @JsonIgnore
	public String getCreatedateStr() {
		return DateUtil.dateFormatStr(DateUtil.DATETIME_FORMAT, this.createdate);
	}

	public Integer getCreateuserid() {
		return createuserid;
	}

	public void setCreateuserid(Integer createuserid) {
		this.createuserid = createuserid;
	}

	public BfCountry getCountry() {
		return country;
	}

	public void setCountry(BfCountry country) {
		this.country = country;
	}

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getRealname() {
        return realname;
    }

    public void setOldpassword(String oldpassword) {
        this.oldpassword = oldpassword;
    }

    public String getOldpassword() {
        return oldpassword;
    }

	public String getCheckcode() {
		return checkcode;
	}

	public void setCheckcode(String checkcode) {
		this.checkcode = checkcode;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}